function * sleep(ms){
    yield new
    Promise(resolve=>{
        setTimeout(resolve,ms)
    })
}

console.log('start')
sleep(1000).next().value.then(()=>{
    console.log('end');
})